<template>
	<m-layout title="提交凭证">
		<text slot="right" style="font-size: 30rpx;color: #FA2B47;" @click="Jump(`/pages/wallet/recharge/recode/recode`)">提交记录</text>
		<m-block spa="24" gap="60 30">
			<view class="flex-between mb-48">
				<view class="fs26">充值银行卡号</view>
				<view class="flex-1 ta-right">
					<input class="fs26" type="text" v-model="bankcard" placeholder="请输入充值银行卡号">
				</view>
			</view>
			<!-- <view class="flex-between mtb-48">
				<view class="fs26">充值流水号</view>
				<view class="">
					<input class="fs26" type="text" v-model="transferNo" placeholder="请输入银行流水号">
				</view>
			</view> -->
			<view class="flex-between">
				<view class="fs26">充值金额</view>
				<view class="flex-1 ta-right">
					<input class="fs26" type="text" v-model="amount" placeholder="请输入充值金额">
				</view>
			</view>
			<view class="mt-48">
				<uploadPhoto v-model="imgList" placeholder="请上传充值凭证" length=1 />
				<!-- <uploadPhoto2 v-model="imgList" placeholder="请上传充值凭证" length=2 /> -->
			</view>
		</m-block>
		<m-block gap="30" bgColor="unset" @click="submit">
			<m-button>提交凭证</m-button>
		</m-block>
	</m-layout>
</template>

<script>
	import { tbvRegister, Getutb } from "@/api/Trade.js"
	export default {
		data() {
			return {
				imgList: [], // 凭证
				amount: '', // 转让金额
				bankcard: '', // 转让银行
				transferNo: '', // 转让流水号
			};
		},
		onShow() {},
		methods: {
			// 提交
			async submit() {
				console.log('this.imgList',this.imgList)
				if (!this.amount || !this.imgList.length||!this.bankcard) return this.Toast('请完善资料')
				const { success, msg, data, code } = await tbvRegister({
					amount: Number(this.amount),
					bankcard: this.bankcard,
					// transferNo: this.transferNo,
					Transfervoucher: this.imgList[0]
				});
				this.Toast(msg);
				if (!success) return
				await this.sleep(500);
				this.Jump(`/pages/wallet/recharge/recode/recode`);
			},

		}
	}
</script>

<style lang="scss">

</style>